home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C++ für Kids
/
C++ for kids.iso
/
Buch
/
TextOut1.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1998-12-23
|
1KB
|
36 lines
//---------------------------------------------------------------------------
#include <vcl\vcl.h>
#pragma hdrstop
#include "TextOut1.h"
//---------------------------------------------------------------------------
#pragma resource "*.dfm"
const int FMax = 16;
TColor Farbe[FMax] =
{clBlack, clMaroon, clGreen, clNavy, clTeal, clPurple,
clOlive, clGray, clSilver, clRed, clLime, clBlue,
clAqua, clFuchsia, clYellow, clWhite};
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
for (int i=0; i<100; i++)
{
Canvas->Font->Color = Farbe[random(FMax)];
Canvas->Font->Height = random(50)+10;
Canvas->TextOut (random (ClientWidth),random (ClientHeight), "Hallo");
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
randomize ();
}
//---------------------------------------------------------------------------